home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
vol15n10.zip
/
WHATIS.ZIP
/
WHATISIT.BAS
next >
Wrap
BASIC Source File
|
1995-12-26
|
1KB
|
40 lines
'WHATISIT.BAS
'Program to display the Module Definition String
'from a Win 3.x executable file (.EXE, .SCR, .DLL, etc.)
INPUT "File to examine"; f$
OPEN f$ FOR BINARY ACCESS READ AS #1
IF LOF(1) = 0 THEN GOTO NoExist
IF LOF(1) < &H2F THEN GOTO ErrorExit
SEEK #1, &H3C + 1
GET #1, , wh% 'Get offset to Windows header,
SEEK #1, wh% + 1 'which should begin with "NE"
a$ = INPUT$(2, 1)
IF a$ = "PE" THEN GOTO ThirtyTwo
IF a$ <> "NE" THEN GOTO ErrorExit
wh% = wh% + &H2C 'DWORD at offset 2CH points to
'nonresident name table
IF wh% >= LOF(1) THEN GOTO ErrorExit
SEEK #1, wh% + 1
GET #1, , rn&
IF rn& >= LOF(1) THEN GOTO ErrorExit
SEEK #1, rn& + 1 'First is Module Definition String.
l$ = INPUT$(1, 1) 'Read lenth byte.
a$ = INPUT$(ASC(l$), 1) 'Read string data
PRINT a$ ' and display it
CLOSE
END
NoExist:
PRINT "File is non-existent or zero-length."
CLOSE
END
ThirtyTwo:
PRINT "Not compatible - 32-bit executable file."
CLOSE
END
ErrorExit:
PRINT "Not a Win 3.1 executable file."
CLOSE
END